package com.android.cattlefarm.util;

/**
 * Created by Huang on 2015/7/4.
 */
public class ExportEntity {
    private String cowNum; //注册牛号
    private String cowfarmNum; //牛场号
    private String cowfarmName; //牛场名
    private String birthday; //出生日期
    private String tyre; //胎次
    private String productionTime; //产犊日期
    private String father; //父号
    private String mother;//母号
    private String grandfather; //外祖父号
    // 体躯容量 尻部 肢蹄 泌乳系统 前乳房 后乳房 乳用特征

    private float tiqurongliang;
    private float kaobu, zhiti, xitong, qianrufang, hourufang, ruyongtezheng;

    private int columnValue[];
    private float average;

    public String getCowNum() {
        return cowNum;
    }

    public void setCowNum(String cowNum) {
        this.cowNum = cowNum;
    }

    public String getCowfarmNum() {
        return cowfarmNum;
    }

    public void setCowfarmNum(String cowfarmNum) {
        this.cowfarmNum = cowfarmNum;
    }

    public String getCowfarmName() {
        return cowfarmName;
    }

    public void setCowfarmName(String cowfarmName) {
        this.cowfarmName = cowfarmName;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getTyre() {
        return tyre;
    }

    public void setTyre(String tyre) {
        this.tyre = tyre;
    }

    public String getProductionTime() {
        return productionTime;
    }

    public void setProductionTime(String productionTime) {
        this.productionTime = productionTime;
    }

    public String getFather() {
        return father;
    }

    public void setFather(String father) {
        this.father = father;
    }

    public String getMother() {
        return mother;
    }

    public void setMother(String mother) {
        this.mother = mother;
    }

    public String getGrandfather() {
        return grandfather;
    }

    public void setGrandfather(String grandfather) {
        this.grandfather = grandfather;
    }

    public int[] getColumnValue() {
        return columnValue;
    }

    public void setColumnValue(int[] columnValue) {
        this.columnValue = columnValue;
    }

    public float getAverage() {
        return average;
    }

    public void setAverage(float average) {
        this.average = average;
    }

    public float getTiqurongliang() {
        return tiqurongliang;
    }

    public void setTiqurongliang(float tiqurongliang) {
        this.tiqurongliang = tiqurongliang;
    }

    public float getKaobu() {
        return kaobu;
    }

    public void setKaobu(float kaobu) {
        this.kaobu = kaobu;
    }

    public float getZhiti() {
        return zhiti;
    }

    public void setZhiti(float zhiti) {
        this.zhiti = zhiti;
    }

    public float getXitong() {
        return xitong;
    }

    public void setXitong(float xitong) {
        this.xitong = xitong;
    }

    public float getQianrufang() {
        return qianrufang;
    }

    public void setQianrufang(float qianrufang) {
        this.qianrufang = qianrufang;
    }

    public float getHourufang() {
        return hourufang;
    }

    public void setHourufang(float hourufang) {
        this.hourufang = hourufang;
    }

    public float getRuyongtezheng() {
        return ruyongtezheng;
    }

    public void setRuyongtezheng(float ruyongtezheng) {
        this.ruyongtezheng = ruyongtezheng;
    }

    public String getPointString(){
        if(columnValue == null || columnValue.length == 0) return "";
        StringBuffer sb = new StringBuffer();
        for(int i:columnValue){
            sb.append(i);
            sb.append(",");
        }
        return sb.toString().substring(0,sb.length() -1);
    }

    public void toPoint(String str){
        if(str == null||str.equals("")) return ;
        try {
            String strs[] = str.split(",");
            columnValue = new int[20];
            for(int i=0;i<strs.length;i++){

                columnValue[i] = Integer.parseInt(strs[i]);
            }
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
    }

    public void update(ExportEntity entity){
        if(cowNum== null||entity == null ||entity.getCowNum() == null
                ||entity.getCowNum().equals("") || entity.getAverage() == 0.0f
                ) return ;
        if(!cowNum.equals(entity.getCowNum())) return ;
        setAverage(entity.getAverage());
        setRuyongtezheng(entity.getRuyongtezheng());
        setXitong(entity.getXitong());
        setHourufang(entity.getHourufang());
        setKaobu(entity.getKaobu());
        setQianrufang(entity.getQianrufang());
        setZhiti(entity.getZhiti());
        setTiqurongliang(entity.getTiqurongliang());
        setColumnValue(entity.getColumnValue());
    }
}